<template>
  <div id="wrap">
    <Scrolltop></Scrolltop>
    <!--头部-->
    <Nav2 :title="title"></Nav2>

    <div class="xinpin">
      <h2>本周新品</h2>
      <p>精选环球好物</p>
    </div>
    <div class="inp">
      <input type="text" @click="hide()" @blur="show()" placeholder="输入商品关键字">
    </div>

    <div class="content" v-for="i in arr">
      <div class="top-img">
        <router-link to="/milk">
          <img :src="i.src" alt="">
          <p>{{i.text}}</p>
        </router-link>
      </div>

      <div class="wrap" >
        <div class="milk-img">
          <div class="milk-info" v-for="item in i.info">
            <router-link to="/milk">
              <div class="mf-top">
                <img :src="item.url" alt="">
              </div>
            </router-link>
            <div class="mf-bottom">
              <h3>{{item.tit}}</h3>
              <span>{{item.price}}</span>
            </div>
          </div>
        </div>
      </div>
    </div>

  </div>
</template>

<script>
  import Scrolltop from './Scrolltop'
  import Nav2 from './Nav2'
  export default {
    name: "Xinpin",
    data(){
      return{
        title:'本周新品',
        bol:true,
        value:'',
        arr:[
          {src:require('../../../static/bmqd/BMQD-4.png'),
            text:'奶粉也要玩有机，养成健康北鼻',
            info:[
              {url:require('../../../static/bmqd/BMQD-5.png'),tit:'诺优能幼儿配 方奶粉',price:'¥59'},
              {url:require('../../../static/bmqd/BMQD-5.png'),tit:'诺优能幼儿配 方奶粉',price:'¥129'},
              {url:require('../../../static/bmqd/BMQD-5.png'),tit:'诺优能幼儿配 方奶粉',price:'¥88'}
            ]
          },
          {src:require('../../../static/bmqd/BMQD-4.png'),
            text:'奶粉也要玩有机，养成健康北鼻',
            info:[
              {url:require('../../../static/bmqd/BMQD-5.png'),tit:'诺优能幼儿配 方奶粉',price:'¥59'},
              {url:require('../../../static/bmqd/BMQD-5.png'),tit:'诺优能幼儿配 方奶粉',price:'¥129'},
              {url:require('../../../static/bmqd/BMQD-5.png'),tit:'诺优能幼儿配 方奶粉',price:'¥88'}
            ]
          },
          {src:require('../../../static/bmqd/BMQD-4.png'),
            text:'奶粉也要玩有机，养成健康北鼻',
            info:[
              {url:require('../../../static/bmqd/BMQD-5.png'),tit:'诺优能幼儿配 方奶粉',price:'¥59'},
              {url:require('../../../static/bmqd/BMQD-5.png'),tit:'诺优能幼儿配 方奶粉',price:'¥129'},
              {url:require('../../../static/bmqd/BMQD-5.png'),tit:'诺优能幼儿配 方奶粉',price:'¥88'}
            ]
          }
        ],

      }
    },
    components:{
      Scrolltop,
      Nav2
    },
    methods:{
      hide(){
        this.bol=false;
      },
      show(){
        this.bol=true;
      },
    }
  }
</script>

<style scoped>
  #wrap{
    background: #f2f2f2;
    position: relative;
  }

  .xinpin{
    width: 68rem;
    height: 9rem;
    background: #fff;
    padding: 1.5rem 2rem;
  }
  .xinpin h2{
    font-size: 3.6rem;
    color: #e53e42;
  }
  .xinpin p{
    font-size: 3rem;
    color: #333333;
  }

  .inp{
    width: 68rem;
    height: 7rem;
    padding: 2rem;
    position: relative;
  }
  .inp input{
    width: 66rem ;
    height: 100%;
    border-radius: 1rem;
    padding-left: 2rem;
    font-size: 3rem;
  }
  input::placeholder{
    text-align: center;
    color: #e83d41;
  }
  .inp p img{
    width: 3rem;
    height: 3rem;
    vertical-align: middle;
  }


  .top-img p{
    position: absolute;
    left: 0;
    bottom: 7rem;
    width: 100%;
    height: 8rem;
    line-height: 8rem;
    font-size: 3rem;
    color: #fff;
    background: rgba(0,0,0,0.3);
    text-align: center;

  }
  .top-img img{
    width: 100%;
    height: 100%;
  }

  .wrap{
    padding:2rem ;
    background: #fff;
    margin-bottom: 2rem;
  }
  .wrap p{
    font-size: 2.8rem;
    color: #4d4d4d;
    margin-bottom: 6rem;
  }
  .milk-img{
    width: 100%;
    display: flex;
    justify-content: space-between;
    /*background: #f00;*/
  }
  .milk-info{
    width: 22rem;
    /*height: 34rem;*/
    /*background: #f00;*/
    margin-bottom: 1rem;
  }
  .mf-top{
    width: 16rem;
    height: 15rem;
    padding:2rem 3rem;
    border: 1px solid #ccc;
  }
  .mf-top img{
    width: 15rem;
    height: 15rem;
  }
  .mf-bottom{
    padding: 1rem 2rem 1rem;
    text-align: center;
  }
  .mf-bottom h3{
    text-align: left;
    font-size: 2.2rem;
    color: #4d4d4d;
  }
  .mf-bottom span{
    display: block;
    color: #e53e42;
    font-size: 2.4rem;
    margin-top: 1rem;
    margin-bottom: 1rem;
  }
</style>

